<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			var year = prompt('请输入你的出生年份：');
			var age = 2021 - year;
			//会有隐式转换把输入的年份转换为数值型
			alert('你今年的年龄是' + age + '岁!');
		</script>
	</head>
	<body>
	</body>
</html>
